#include<stdio.h>
void insertsort(int* arr, int n)
{
	for (int i = 0;i < n - 1;i++)
	{
		int end = i;
		int tmp = arr[end + 1];
		while (end >= 0)
		{
			if (tmp < arr[end])
			{
				arr[end + 1] = arr[end];
				end--;
			}
			else
			{
				break;
			}
		}
		arr[end + 1] = tmp;
	}
}
int main()
{
	int a[] = { 2,56,43,6,23,89,54,46 };
	insertsort(a, sizeof(a) / sizeof(a[0]));
	for (int i = 0;i < sizeof(a) / sizeof(a[0]);i++)
	{
		printf("%d ", a[i]);
	}
	return 0;
}